package com.ebraga.trackerclub.android.manager.api;

import com.ebraga.trackerclub.android.dao.entity.UserAndroid;
import com.ebraga.trackerclub.android.exception.BackofficeDBConnectionException;
import com.ebraga.trackerclub.android.exception.manager.BackofficeIllegalArgumentManagerException;
import com.ebraga.trackerclub.android.exception.manager.BackofficeManagerException;

public interface LoginManager {
	
	/**
	 * Method responsible for update user on local database after successful loginOnline
	 * 
	 * @param user
	 * @throws BackofficeManagerException 
	 */
	void loginOnline(UserAndroid user) throws BackofficeManagerException;
	
	/**
	 * If loginOnline fails, user is authenticated from local database
	 * 
	 * @param user
	 * @throws BackofficeManagerException
	 */
	void loginOffline(UserAndroid user) throws BackofficeManagerException;

	/**
	 * Method responsible for verifying the user's last login
	 * 
	 * @return
	 */
	UserAndroid checkLastLogin() throws BackofficeManagerException;
	
	/**
	 * Method responsible for return user's last login
	 * 
	 * @return
	 */
	UserAndroid lastLogin() throws BackofficeManagerException;	
	
	/**
	 * Method responsible for get uset by id.
	 * 
	 * @param user
	 */
	UserAndroid getUser(String login) throws BackofficeIllegalArgumentManagerException,
	BackofficeDBConnectionException , BackofficeManagerException;
	
}
